<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/html/js/axios.min.js"></script>
    <script src="/html/js/ajax.js"></script>
    <script src="/html/js/util.js"></script>
    <script>
        async function add(){
            let info=await uploadAjaxPost("/product/add",{
                name:getObject("name").value,
                money:getObject("money").value,
                area:getObject("area").value,
                face:getObject("face").files[0]
            });
            if (info=="ok"){
                alert("添加成功");
                location.href="/html/ass/index.html";
            }
        }
    </script>
</head>
<body>
<div style="margin-left: 100px;margin-top: 100px">
    商品名:<input type="text" id="name"><br>
    商品单价:<input type="text" id="money"><br>
    商品产地:<input type="text" id="area"><br>
    <img src="" id="faceImg" width="200" height="200"><br>
    选择图片:<input type="file" name="face" id="face" onchange="fileChange('face','faceImg')"><br>
    <input type="button" value="添加" onclick="add()">
</div>
</body>
</html>